<?php

namespace Keio\StudyBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * Blogcategory
 */
class Blogcategory
{
    /**
     * @var integer
     */
    private $id;

    /**
     * @var string
     */
    private $name;

    /**
     * @var \Doctrine\Common\Collections\Collection
     */
    private $blog;

    /**
     * Constructor
     */
    public function __construct()
    {
        $this->blog = new \Doctrine\Common\Collections\ArrayCollection();
    }

    /**
     * Get id
     *
     * @return integer
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set name
     *
     * @param string $name
     * @return Blogcategory
     */
    public function setName($name)
    {
        $this->name = $name;

        return $this;
    }

    /**
     * Get name
     *
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Add blog
     *
     * @param \Keio\StudyBundle\Entity\Blog $blog
     * @return Blogcategory
     */
    public function addBlog(\Keio\StudyBundle\Entity\Blog $blog)
    {
        $this->blog[] = $blog;

        return $this;
    }

    /**
     * Remove blog
     *
     * @param \Keio\StudyBundle\Entity\Blog $blog
     */
    public function removeBlog(\Keio\StudyBundle\Entity\Blog $blog)
    {
        $this->blog->removeElement($blog);
    }

    /**
     * Get blog
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getBlog()
    {
        return $this->blog;
    }

    public function __toString()
	{
  		return $this->getName();
	}
}